//
//  NSString+Clear.m
//  Calendar
//
//  Created by esi dwk on 12-5-25.
//  Copyright (c) 2012年 esi. All rights reserved.
//

#import "NSString+Clear.h"

@implementation NSString (Clear)

-(NSString *)stringCleared:(NSString *)str
{
    str = [str stringByReplacingOccurrencesOfString:@" " withString:@"" options:NSCaseInsensitiveSearch range:NSMakeRange(0, [str length])];
    str = [str stringByReplacingOccurrencesOfString:@"\n" withString:@"" options:NSCaseInsensitiveSearch range:NSMakeRange(0, [str length])];
    str = [str stringByReplacingOccurrencesOfString:@"\t" withString:@"" options:NSCaseInsensitiveSearch range:NSMakeRange(0, [str length])];
    return str;
}

-(BOOL)stringWithNothing:(NSString *)str
{
    if ([[self stringCleared:str] isEqualToString:@""]) {
        return YES;
    }
    return NO;
}
@end
